
import { connect } from 'react-redux'
import TaskItem from './TaskItem'

function TasksList(props) {
    console.log('props',props);
    const {tasks} = props
    return (
        <div>
            <ul>
                {
                    tasks.map((item,index)=>{
                        return <TaskItem  key={index} item={item} index={index}/>
                    })
                }
            </ul>
        </div>
    )
  }


  export default connect(state=>({tasks:state.task.tasks}),null)(TasksList)